= comfy_admin_partial "comfy/admin/cms/partials/layout_form_before", form: form

= form.text_field :label, data: {slugify: @layout.new_record?}
= form.text_field :identifier, data: {slug: true}

- if (options = Comfy::Cms::Layout.options_for_select(@site, @layout)).present?
  = form.select :parent_id, [["---- #{t('.select_parent_layout')} ----", nil]] + options, bootstrap: {custom_control: true}

- if (options = Comfy::Cms::Layout.app_layouts_for_select(lookup_context.view_paths)).present?
  = form.select :app_layout, [["---- #{t('.select_app_layout')} ----", nil]] + options, bootstrap: {custom_control: true}

= form.text_area :content, data: {'cms-cm-mode' => 'text/html'}
= form.text_area :css, data: {'cms-cm-mode' => 'css'}
= form.text_area :js, data: {'cms-cm-mode' => 'javascript'}

= comfy_admin_partial "comfy/admin/cms/partials/layout_form_after", form: form

= form.form_actions do
  = submit_tag t(@layout.new_record? ? ".create" : ".update"), class: "btn btn-primary"
  = link_to t('.cancel'), comfy_admin_cms_site_layouts_path, class: "btn btn-link"
